/** @odoo-module **/

import { patch } from "@web/core/utils/patch";
import { user } from "@web/core/user";
import { WebClient } from "@web/webclient/webclient";

import {
    Component,
    onMounted,
    mount,
    xml,
    useEnv,
    App,
    useSubEnv,
    reactive,
    useState,
    markup, useRef,
  } from "@odoo/owl";
 
import { multi_tab_action_container } from "./multi_tab_action_container";
let WebClientEnterprise = null;
//import { WebClientEnterprise } from "@web_enterprise/webclient/webclient";
const enterpriseModule = odoo.loader.modules.get("@web_enterprise/webclient/webclient");
if  (enterpriseModule) {
    console.log("enterpriseModule");
    WebClientEnterprise = enterpriseModule.WebClientEnterprise;
}
else {
    WebClientEnterprise = WebClient;
}
const originalSetup = WebClientEnterprise.prototype.setup;
export class Test0001 extends Component {
 
    static template = xml`
 11111111111111111111111
`;

} 
 
 
patch(WebClientEnterprise.prototype, {
    setup() {
        console.log("WebClientEnterprise setup000002");
        WebClientEnterprise.components = {
            ...WebClientEnterprise.components,
            Multi_tab_action_container: multi_tab_action_container,    
            Abc:Test0001    
         }

        // 调用原始 setup
         originalSetup.call(this);
   
        
        // 示例：添加 orm 服务
        this.orm11 = this.env.services.orm;
        console.log(user); 
        if (user.context.abcdefg) {
            this.shouldUseMulActionContainer=true
        }
        else    {
            this.shouldUseMulActionContainer=false
        }
       
       
        
    },

    // 添加方法
  
});
